<?php

abstract class HTMLTemplate
{
	public $title;
	public $date;
	public $project = true;
	public $smarty;
	public $company;

	/**
	 * Returns the template's HTML header
	 * @return string HTML header
	 */
	public function getHeader()
	{
		
		return '<div style="display:block; border-buttom:1px solid;font-size:8pt">
				'.settings::get("name").' '.settings::get("subtitle").'</div>';
	}

	/**
	 * Returns the template's HTML footer
	 * @return string HTML footer
	 */
	public function getFooter()
	{
		return '<div style="display:block; border-top:0.5px solid;font-size:8pt">
				'.settings::get("name").' '.settings::get("subtitle").'</div>';
		

		
	}

	

	/**
	 * Returns the invoice logo
	 */
	protected function getLogo()
	{
		//not yet implemented;
	}

	

	/**
	 * Returns the template's HTML content
	 * @return string HTML content
	 */
	abstract public function getContent();


	/**
	 * Returns the template filename
	 * @return string filename
	 */
	abstract public function getFilename();

	/**
	 * Returns the template filename when using bulk rendering
	 * @return string filename
	 */
	abstract public function getBulkFilename();

	/**
	 * If the template is not present in the theme directory, it will return the default template
	 * in PDF_DIR_ directory
	 *
	 * @param $template_name
	 * @return string
	 */
	protected function getTemplate($template_name)
	{
		$template = false;
		$default_template = PDF_DIR_.'/'.$template_name.'.tpl';
		$overriden_template = THEME_DIR_.'pdf/'.$template_name.'.tpl';

		if (file_exists($overriden_template))
			$template = $overriden_template;
		else if (file_exists($default_template))
			$template = $default_template;

		return $template;
	}


	/**
	 * Translatation method
	 * @param string $string
	 * @return string translated text
	 */
	protected static function l($string)
	{
		return $string;
	}
}

